package com.ruoyi.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.business.domain.Question;
import com.ruoyi.business.domain.bo.FinishedHomeWorkBo;
import com.ruoyi.business.domain.vo.CourseHomeWorkVo;

import java.util.List;
import com.ruoyi.business.domain.bo.QuestionBo;
import com.ruoyi.business.domain.vo.QuestionVo;
import org.apache.ibatis.annotations.Param;

/**
 * @author 最爱喝兽奶
 * @create 2022/8/9
 **/
public interface QuestionMapper extends BaseMapper<Question> {

    /**
     * 根据题型，随机查询limit条题目
     * @param courseId
     * @param type
     * @param limit
     * @return
     */
    List<String> randQueryQuestionByType(@Param("courseId") String courseId,
                                         @Param("type") String type,
                                         @Param("limit") int limit);

    /**
     * 分页查询题目信息
     * @param buildPage
     * @param bo
     * @return
     */
    Page<QuestionVo> queryPageList(@Param("page") Page<QuestionVo> buildPage, @Param("bo") QuestionBo bo);




    public List<CourseHomeWorkVo> getHomeWorkByCourseIdNoAnswer(String courseId);

    public List<CourseHomeWorkVo> getHomeWorkByCourseIdWithAnswer(FinishedHomeWorkBo bo);


    /**
     * 根据传入的问题的id来查询问题的vo对象
     * @param questionIds
     * @return
     */
    List<QuestionVo> selectQuestionVoByQuestionIds(@Param("questionIds") List<String> questionIds);

    /**
     * 根据题目id，查询出题目类型
     * @param id
     * @return
     */
    String selectTypeById(@Param("id") String id);
}
